package net.atos.excercise1;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

@Configuration
@ComponentScan(basePackages = "net.atos")
public class ScannedConfig {

    @Bean
    public static PropertySourcesPlaceholderConfigurer propertyConfigurer() {

	final PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
	final Resource[] resourceLocations = new Resource[] {
		new ClassPathResource("other.properties"),
		new ClassPathResource("RealLibrary.properties")
	};
	configurer.setLocations(resourceLocations);
	return configurer;
    }
}
